﻿<html lang="en">
  <head>
    <!-- Required meta tags -->
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

    <!-- Bootstrap CSS -->
    <link rel="stylesheet" href="/static/css/bootstrap.min.css">

    <link rel="stylesheet" href="/static/font-awesome/css/font-awesome.min.css">

    <link rel="stylesheet" href="/static/bootstrap-multiselect/dist/css/bootstrap-multiselect.css" type="text/css"/>

    <link rel="stylesheet" href="/static/css/base.css">
      {% block css %}

      {% endblock %}

    <title>{{ title }}</title>

  </head>
  <body>
    <!--头部导航-->
    <nav class="nav navbar-default navbar-mystyle navbar-fixed-top">
        <div class="navbar-header">
            <button class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
             <span class="icon-bar"></span>
             <span class="icon-bar"></span>
             <span class="icon-bar"></span>
            </button>
            <a href="/" class="navbar-brand mystyle-brand"><i class="fa fa-home fa-lg"></i> </a>
        </div>

        <div class="collapse navbar-collapse" style="padding-right:50px;">
            <ul class="nav navbar-nav">
              <li class="li-border"><a class="mystyle-color" href="#">运维管理系统</a></li>
            </ul>

            <ul class="nav navbar-nav pull-right">
               <li class="li-border">
                  <a href="#" class="mystyle-color">
                    <span class="fa fa-bell"></span>
                    <span class="topbar-num">0</span>
                  </a>
              </li>


              <li class="dropdown li-border"><a href="#" class="dropdown-toggle mystyle-color" data-toggle="dropdown">{{ request.session.username }}<span class="caret"></span></a>
                <ul class="dropdown-menu">
                  <li><a href="#" style="padding: 3px 14px;">修改</a></li>
                  <li><a href="/auth/logout/" style="padding: 3px 14px;">退出</a></li>
                </ul>
              </li>
            </ul>
        </div>
    </nav>

    <!--主页-->
    <div class="down-main left-full">
        <!--左侧菜单导航-->
      <ul class="left-main left-full">

        <div class="sidebar-fold"><span class="fa fa-bars"></span></div>

        <ul>

            <ul id="menu-left">

                {% for i in request.session.menu_all_list %}

                <li class="nav-item">
                    {% if i.menu_two %}
                    <a href="#" style="display:block;text-decoration:none">
                        <i class="{{ i.perms_icon }}" style="margin-left:17px"></i><span name="menu-one" class="nav-text">{{ i.perms_title }}</span>

                        <i class="my-icon fa fa-angle-down pull-right" style="margin-right:15px;"></i>

                    </a>
                    {% else %}
                    <a href="{{ i.perms_url }}" style="display:block;text-decoration:none">
                        <i class="{{ i.perms_icon }}" style="margin-left:17px"></i><span class="nav-text">{{ i.perms_title }}</span>

                    </a>
                    {% endif %}

                    {% if i.menu_two %}

                    <ul class="nav-ul nav" style="display:none">
                        {% for j in i.menu_two %}
                            {% if j.perms_url == '/log/elk/' or  j.perms_url == '/sys/nessus/' %}
                            <li ><a href="{{ j.perms_url }}" target="_blank" style="display:block;text-decoration:none"><span>{{ j.perms_title }}</span></a></li>
                            {% else %}
                            <li ><a href="{{ j.perms_url }}" style="display:block;text-decoration:none"><span>{{ j.perms_title }}</span></a></li>
                            {% endif %}

                        {% endfor  %}
                    </ul>

                    {% endif %}

                </li>

                {% endfor %}



            </ul>
        </ul>

      </ul>



        <!--右侧内容-->
      <div class="right-product my-index right-full" style="min-width:1320px;">
         <div class="container-fluid">
           <div class="info-center">

               {% block center %}

           <!---title----->
                <div class="info-title">
                  <div class="pull-left">
                    <h4 style="color:#09C"><strong>{{ request.session.username }}，</strong></h4>
                    <h4 style="color:#09C">欢迎登录管理系统！</h4>
                  </div>
                  <div class="time-title pull-right">
                      <div class="year-month pull-left">
                        <p>{{ A }}</p>
                        <p><span style="font-size:20px">{{ Y }}</span>年{{ m }}月{{ d }}日</p>
                      </div>
                      <div class="hour-minute pull-right">
                         <strong style="font-size: 35px;">{{ H_M }}</strong>
                      </div>
                  </div>
                  <div class="clearfix"></div>
                </div>
               <!----content-list---->
                <div class="content-list">
                   <div class="row">
                     <div class="col-md-3">
                        <div class="content">
                           <div class="right-title">
                               <div class="row">
                                   <div style="margin-top:10px;" class="row">
                                       <div class="col-sm-6">
                                           <span>主机总数</span>
                                       </div>
                                       <div class="col-sm-6 pull-right">
                                           <span class="label label-primary">Hosts</span>
                                       </div>

                                   </div>

                                   <hr>

                                   <div>
                                       <a href="/cmdb/hostinfo/" style="color: #428bca;text-decoration: none;"><h1>{{ host_num }}</h1></a>
                                   </div>


                               </div>
                           </div>

                           <div class="clearfix"></div>
                        </div>
                     </div>


                      <div class="col-md-3">
                        <div class="content">
                            <div class="right-title">
                               <div class="row">
                                   <div style="margin-top:10px;" class="row">
                                       <div class="col-sm-6">
                                           <span>任务</span>
                                       </div>
                                       <div class="col-sm-6 pull-right">
                                           <span class="label label-danger">Task</span>
                                       </div>

                                   </div>

                                   <hr>

                                   <div>
                                       <a href="#" style="color: #428bca;text-decoration: none;"><h1>20</h1></a>
                                   </div>


                               </div>
                           </div>
                           <div class="clearfix"></div>
                        </div>
                     </div>
                      <div class="col-md-3">
                        <div class="content">
                           <div class="right-title">
                               <div class="row">
                                   <div style="margin-top:10px;" class="row">
                                       <div class="col-sm-6">
                                           <span>用户总数</span>
                                       </div>
                                       <div class="col-sm-6 pull-right">
                                           <span class="label label-info ">Users</span>
                                       </div>

                                   </div>

                                   <hr>

                                   <div>
                                       <a href="/rbac/usermg/" style="color: #428bca;text-decoration: none;"><h1>{{ user_num }}</h1></a>
                                   </div>


                               </div>
                           </div>

                           <div class="clearfix"></div>
                        </div>
                     </div>
                      <div class="col-md-3">
                        <div class="content">
                           <div class="right-title">
                               <div class="row">
                                   <div style="margin-top:10px;" class="row">
                                       <div class="col-sm-6">
                                           <span>在线会话</span>
                                       </div>
                                       <div class="col-sm-6 pull-right">
                                           <span class="label label-success ">Session</span>
                                       </div>

                                   </div>

                                   <hr>

                                   <div>
                                       <a href="/cmdb/hostinfo/" style="color: #428bca;text-decoration: none;"><h1>1</h1></a>
                                   </div>


                               </div>
                           </div>
                           <div class="clearfix"></div>
                        </div>
                     </div>
                   </div>

                   <!-------信息列表------->
                   <div class="row newslist" style="margin-top:20px;">
                     <div class="col-md-8">
                       <div class="panel panel-default">
                          <div class="panel-heading">
                           我的事务<div class="caret"></div>
                           <a href="#" class="pull-right"><span class="fa fa-refresh"></span></a>
                          </div>
                          <div class="panel-body">
                               <div class="w15 pull-left">
                                 <span class="fa fa-user-circle fa-lg"></span>
                                 安妮
                               </div>
                               <div class="w55 pull-left">系统需要升级</div>
                               <div class="w20 pull-left text-center">2016年8月23日</div>
                              <div class="w10 pull-left text-center"><span class="text-green-main">处理中</span></div>
                          </div>

                          <div class="panel-body">
                               <div class="w15 pull-left">
                                 <span class="fa fa-user-circle fa-lg"></span>
                                 安妮
                               </div>
                               <div class="w55 pull-left">系统需要升级</div>
                               <div class="w20 pull-left text-center">2016年8月23日</div>
                              <div class="w10 pull-left text-center"><span class="text-green-main">处理中</span></div>
                          </div>

                          <div class="panel-body">
                               <div class="w15 pull-left">
                                 <span class="fa fa-user-circle fa-lg"></span>
                                 安妮
                               </div>
                               <div class="w55 pull-left">系统需要升级</div>
                               <div class="w20 pull-left text-center">2016年8月23日</div>
                               <div class="w10 pull-left text-center"><span class="text-gray">已关闭</span></div>
                          </div>

                          <div class="panel-body">
                               <div class="w15 pull-left">
                                 <span class="fa fa-user-circle fa-lg"></span>
                                 安妮
                               </div>
                               <div class="w55 pull-left">系统需要升级</div>
                               <div class="w20 pull-left text-center">2016年8月23日</div>
                               <div class="w10 pull-left text-center"><span>处理中</span></div>
                          </div>
                          <div class="panel-body">
                               <div class="w15 pull-left">
                                 <span class="fa fa-user-circle fa-lg"></span>
                                 安妮
                               </div>
                               <div class="w55 pull-left">系统需要升级</div>
                               <div class="w20 pull-left text-center">2016年8月23日</div>
                               <div class="w10 pull-left text-center"><span>处理中</span></div>
                          </div>
                          <div class="panel-body">
                               <div class="w15 pull-left">
                                 <span class="fa fa-user-circle fa-lg"></span>
                                 安妮
                               </div>
                               <div class="w55 pull-left">系统需要升级</div>
                               <div class="w20 pull-left text-center">2016年8月23日</div>
                               <div class="w10 pull-left text-center"><span>处理中</span></div>
                          </div>

                          <div class="panel-body text-center">
                              <a href="#" style="color:#5297d6;">查看全部</a>
                          </div>

                        </div>
                     </div>

                     <div class="col-md-4">
                         <div class="panel panel-default">
                          <div class="panel-heading">
                           我的事务统计
                           <a href="#" class="pull-right"><span class="fa fa-refresh"></span></a>
                          </div>
                          <div class="panel-body">
                                8888888888888
                          </div>
                        </div>

                     </div>
                   </div>
                </div>
               {% endblock %}

           </div>
         </div>
      </div>
    </div>


    {% block modal %}

    {% endblock  %}


    <!-- Optional JavaScript -->
    <!-- jQuery first, then Popper.js, then Bootstrap JS -->
    <script src="/static/js/jquery-3.2.1.min.js"></script>
    <script src="/static/js/bootstrap.min.js"  ></script>
    <script type="text/javascript" src="/static/bootstrap-multiselect/dist/js/bootstrap-multiselect.js"></script>
    <script src="/static/js/base.js"  ></script>
    <script>

        //二级菜单展开
        var title = "{{ title }}";

            $("#menu-left").find("a").each(function(){

                if(title == $(this).text()){
                    $(this).parents('.nav-ul').css('display','block');
                    return false;
                }
            });


    </script>

    {% block js %}



    {% endblock %}

  </body>
</html>
